package com.caoaman.sharding.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.caoaman.sharding.model.Order;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @ClassName: OrderMapper
 * @Description: 订单数据仓库
 * @Author: CaoAMan
 * @Create: 2021-12-18 16:17
 */
public interface OrderMapper extends BaseMapper<Order> {

    /**
     * 创建分片表
     */
    void createTable();

    /**
     * 创建广播表
     */
    void createBroadcast();

    /**
     * mybatis插入数据
     * @param order
     */
    void insertOrder(Order order);

    /**
     * 非分片字段关联查询
     * @return
     */
    List<Order> joinQuery();

    /**
     * 分片键关联查询
     * @return
     */
    List<Order> joinQuery1();

    /**
     * 分页关联查询
     * @param page
     * @return
     */
    IPage<Order> joinQuery1(Page page);
}
